#ifndef __UART1_H
#define __UART1_H
#include "main.h"


#define RS485_RX_LEN 40
#define QUEUELEN 40
#define QUEUELEN_tx 40

extern volatile UINT08 time_st;
extern volatile UINT08 qita_cmd;
extern volatile UINT08 USRT_TXDATA;

extern UINT08 MYUSART_1[RS485_RX_LEN];
extern UINT08 MYUSART_2[RS485_RX_LEN];
extern UINT08 RS485_TX_BUF[RS485_RX_LEN];

extern volatile UINT08 CH1_8;  
extern volatile UINT08 CH9_16; 
extern volatile UINT08 CH17_24;
extern volatile UINT08 CH25_30;

extern UINT08 CRC_lens;
extern UINT08 Crc8_load;

extern UINT08 queuehead;
extern UINT08 queuetail;
extern UINT08 queuehead_tx;
extern UINT08 queuetail_tx;

extern volatile UINT08 Is_interrupted;

/*
extern UINT08 MYUSART_1[RS485_RX_LEN];
extern UINT08 MYUSART_2[RS485_RX_LEN];

*/

UINT08 crc8_chack(UINT08 *message, UINT08 len);
void RS485_Data_parsing(void);

void Uart_Init(void);
void Uart1_Recv(void);
void Uart1_Send(void);
void Uart1_Tx(); 
UINT08 testQueue_tx(void);
UINT08 getMsg_tx(void);
void putMsg_tx(UINT08 m_tx);
UINT08 testQueue(void);
UINT08 getMsg(void);
void putMsg(UINT08 m);
UINT08 Uart_Flag;

#endif
